﻿//#define METAXML

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Xml;
using System.Runtime.InteropServices;

using SuperMapLib;

namespace SDB2DM
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox1.Text = openFileDialog1.FileName;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox2.Text = saveFileDialog1.FileName;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            button3.Enabled = false;
            button4.Enabled = true;

            //メインデータのXML文書
            XmlDocument doc = null;
            IJPGISXML jpgisXML = 
                new SDB2DM.JPGISMain(doc, axSuperWorkspace1, textBox1.Text, textBox2.Text);
            jpgisXML.BuildXML();

#if METAXML
            //メタデータのXML文書
            doc = null;
            jpgisXML = new SDB2DM.JPGISMeta(doc, textBox1.Text, textBox2.Text);
            jpgisXML.BuildXML();
#endif

            button3.Enabled = true;
            button4.Enabled = false;
        }
    }
}